package builder;

import java.util.Vector;

import model.Action;

public class VisitorBuilder extends AbstractPatternBuilder {

	private String client = "Client";
	private String visitor = "Visitor";
	private String concreteVisitor1 = "ConcreteVisitor1";
	private String concreteVisitor2 = "ConcreteVisitor2";
	private String objectStructure = "ObjectStructure";
	private String element = "Element";
	private String concreteElementA = "ConcreteElementA";
	private String concreteElementB = "ConcreteElementB";
	
	public VisitorBuilder() {
		super();
	}

	@Override
	public Vector<Action> buildPattern() {
		
		this.buildClass(client);	
		this.buildClass(concreteVisitor1);	
		this.buildClass(concreteVisitor2);	
		this.buildClass(objectStructure);
		this.buildClass(concreteElementA);	
		this.buildClass(concreteElementB);
			
		this.buildAbstractClass(visitor);	
		this.buildAbstractClass(element);
		
		this.buildGeneralization(concreteVisitor1, visitor);
		this.buildGeneralization(concreteVisitor2, visitor);
		this.buildGeneralization(concreteElementA, element);
		this.buildGeneralization(concreteElementB, element);
		
		this.buildAssociation(client, visitor);
		this.buildAssociation(client, objectStructure);
		this.buildAssociation(objectStructure, element);
		
		return patternActions;
	}

	@Override
	public void changeNames() {

		client = names.get(0);
		visitor = names.get(1);
		concreteVisitor1 = names.get(2);
		concreteVisitor2 = names.get(3);
		objectStructure = names.get(4);
		element = names.get(5);
		concreteElementA = names.get(6);
		concreteElementB = names.get(7);
		
	}
	
	@Override
	public int cantUMLElements() {
		return 8;
	}

}
